/*
 * Copyright (c) 2010-2013 Ruben Chakhmakhchyan. All rights reserved.
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Eclipse Public License
 * Version 1.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://opensource.org/licenses/EPL-1.0 and read it before using this file.
 */

#include "zlib_encoder.h"
#include "zlib.h"

#pragma warning( disable : 4996 )


bool ZlibEncoder::Compress( byte_t* dest, ulong_t* destLen, const byte_t* source, ulong_t sourceLen )
{
    int result = ::compress( dest, destLen, source, sourceLen );
    return result == Z_OK;
}

bool ZlibEncoder::Compress2( byte_t* dest, ulong_t* destLen, const byte_t* source, ulong_t sourceLen, int level )
{
    int result = ::compress2( dest, destLen, source, sourceLen, level );
    return result == Z_OK;
}

bool ZlibEncoder::Uncompress( byte_t *dest, ulong_t *destLen, const byte_t *source, ulong_t sourceLen )
{
    int result = ::uncompress( dest, destLen, source, sourceLen );
    return result == Z_OK;
}
